export default {
  isLoading: false,
  wxShowLoading () {
    wx.showLoading({
      mask: true,
      title: '加载中...'
    })
  },
  preview (e) {
    wx.previewImage({
      current: 0,
      urls: e.currentTarget.dataset.urls
    })
  },
  wxHideLoading () {
    wx.hideLoading();
  },
  /**
   * 变更值
   * @param {String} prop 要变更的变量名
   * @param {*} value 要变更的变量值
   */
  updateData (prop, value) {
    let empty = {}
    empty[prop] = arguments.length > 1 ? value : this.data[prop]
    this.setData(empty)
  }
}